import 'package:flutter/material.dart';

/**
 * 用户信息
 */
class UserInfo extends StatefulWidget {
  @override
  UserInfoState createState() => new UserInfoState();
}

class UserInfoState extends State<UserInfo> {
  @override
  Widget build(BuildContext context) {
    double mediaWidth = MediaQuery.of(context).size.width; // 屏幕宽度
    return Container(
        child: Column(
      children: [
        Image(
          image: AssetImage("images/1.jpg"),
          fit: BoxFit.cover,
          width: mediaWidth,
          height: 300,
        ),
        Padding(
          padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
          child: Flex(
            direction: Axis.horizontal,
            children: [
              Expanded(
                  flex: 0,
                  child: Padding(
                      padding: const EdgeInsets.fromLTRB(0, 0, 20, 0),
                      child: ClipOval(
                        child: Image(
                          image: AssetImage("images/2.jpg"),
                          fit: BoxFit.cover,
                          width: 100,
                          height: 100,
                        ),
                      ))),
              Expanded(
                  flex: 1,
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        "小飘飘",
                        textAlign: TextAlign.left,
                        maxLines: 1,
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(
                          color: Colors.black,
                          fontSize: 20.0,
                          height: 2,
                        ),
                      ),
                      Padding(
                        padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
                        child: Text(
                          "唯有美食不可辜负",
                          textAlign: TextAlign.left,
                          maxLines: 1,
                          style: TextStyle(
                              fontSize: 13.0, color: Colors.grey, height: 1.0),
                        ),
                      )
                    ],
                  )),
            ],
          ),
        )
      ],
    ));
  }
}
